//
//  DMNavigationController.m
//  MCNKuaiYi
//
//  Created by Mr.Cannon on 2017/1/7.
//  Copyright © 2017年 Mr.Cannon. All rights reserved.
//

#import "DMNavigationController.h"

@interface DMNavigationController ()

@end

@implementation DMNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupUI];
}
-(UIStatusBarStyle)preferredStatusBarStyle
{
    return UIStatusBarStyleDefault;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
#pragma mark - 初始化界面
-(void)setupUI
{
    //让导航条不透明
    self.navigationBar.translucent = NO;
    //取出导航条分割线
    self.navigationBar.shadowImage = [[UIImage alloc]init];
    [self.navigationBar setBackgroundImage:[[UIImage alloc]init] forBarMetrics:UIBarMetricsDefault];
    //设置背景颜色
    self.navigationBar.barTintColor = DMRGBCOLOR;
    //设置字体颜色
    [self.navigationBar setTitleTextAttributes:@{
                                                NSForegroundColorAttributeName:
                                                    [UIColor whiteColor]}];
    //设置navigationItem的BarButtonItem
    [self.navigationBar setTintColor:[UIColor whiteColor]];
    
}
//跳转其他页面的时候隐藏tabber,并且设置返回的item文字为返回
-(void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
    if(self.viewControllers.count > 0)
    {
        viewController.hidesBottomBarWhenPushed  = YES;
        //设置返回文字
        viewController.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"返回" style:UIBarButtonItemStylePlain target:self action:@selector(goBackAction)];
    }
    [super pushViewController:viewController animated:animated];
}
//点击返回的方法
-(void)goBackAction{}
@end
